home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / borland / jnfb88.zip / GETCPU.ZIP / WHATCPU.C < prev    next >
Text File  |  1987-09-21  |  812b  |  28 lines

  1. /* --------------------------------------------------------------- */
  2. /* WHATCPU.C - Turbo C program to show example of how to use the   */
  3. /*           C_GETCPU assembly language module.                    */
  4. /* --------------------------------------------------------------- */
  5.  
  6. #include <stdio.h>
  7.  
  8. int C_GETCPU();
  9.  
  10. main()
  11. {
  12.   int    CPU_Type;            /* Receives result       */
  13.   CPU_Type = C_GETCPU();        /* Call the function     */
  14.   printf("Processor is [80");        /* Print common msg      */
  15.   switch (CPU_Type)            /* Depending on result   */
  16.   {                    /* Print rest of msg     */
  17.     case 386:    printf("386");
  18.         break;
  19.     case 286:    printf("286");
  20.         break;
  21.     case 186:    printf("188/186");
  22.         break;
  23.     case  86:     printf("88/86");
  24.         break;
  25.   }
  26.   printf("]\n");            /* Terminate msg string  */
  27. }
  28.